home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / ARCHIVE / DWARCS12.ZIP;1 / DWADEMO.BAS next >
Encoding:
BASIC Source File  |  1993-04-01  |  2.3 KB  |  50 lines

  1. $IF 0
  2.   DWArcs version 1.2
  3.   Written by James R. Davis
  4.   (C) Copyright 1993 - All rights Reserved
  5.  
  6.   This library is a set of routines that will read in file data from
  7.   any archive format.  The following formats that are supported and version
  8.   numbers are:
  9.  
  10.                     ZIP - PKZIP up to version 2.04G
  11.                     ARC - PKARC up to version 5.10
  12.                     PAK - PKPAK up to version 2.51
  13.                     ZOO - Zoo up to version 2.1
  14.                     LZH - LHArc up to version 1.13c
  15.                     ARJ - ARJ up to version 2.39a BETA
  16.  
  17.   The following libraries are for the different PowerBASIC versions:
  18.  
  19.               DWARCS2F.PBU - For version 2.10f of PowerBASIC
  20.               DWARCS3A.PBU - For version 3.00a of PowerBASIC
  21.  
  22.   A version for 3.00b of PowerBASIC will be released soon.  See documentation
  23.   for further information about this library and other info.
  24.  
  25. $ENDIF
  26.  
  27. $LINK "DWARCS2F.PBU"               'Link in our PBU
  28. PUBLIC Net%                        'Declare Net% variable for networking
  29.  
  30. CLS                                'Clear the screen
  31. File$=UCASE$(COMMAND$)             'Use filename specified on command line
  32. PRINT "Archive: ";File$            'Print initial information
  33. ArcFile$=ArcDir$(File$)            'Get the first filename from the archive
  34. WHILE ArcFile$<>""                 'Start loop, test ArcFile$
  35.   PRINT ArcFile$,                  'Print first filename
  36.                                    'Get inforamtion on file in archive, below
  37.   CALL ArcInfo(File$,ArcFile$,FileDate$,FileTime$,FileSize$,CompSize$)
  38.   PRINT FileSize$,CompSize$,FileDate$;" ";FileTime$;" ";
  39.                                    'Print compression percentage, below
  40.   PRINT USING$("###%",100-INT((100/VAL(FileSize$))*VAL(CompSize$)))
  41.   INCR TotalByte&&,VAL(FileSize$)  'Increment total actual filesizes
  42.   INCR TotalComp&&,VAL(CompSize$)  'Increment total compressed filesizes
  43.   ArcFile$=ArcDir$(File$)          'Get next filename in archive
  44. WEND                               'Continue loop
  45.                                    'Print number of files in archive, etc
  46. PRINT ArcFiles%(File$);"Files   Compressed:";TotalComp&&;"  Actual:";TotalByte&&
  47.  
  48. 'PRINT SearchArc%(File$,Search$)   'Use this if you want to find a file in
  49.                                    'an archive.
  50.